<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>File List</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
    <div class="container">
        <h1>Your Files</h1>
        <form method="POST" action="{{ url_for('file_list') }}">
                        <!-- 添加 CSRF 令牌字段 -->
            <input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
            <input type="text" name="filename" placeholder="New File Name" required>
            <button type="submit">Create File</button>
        </form>
        <table>
            <tr>
                <th>File Name</th>
                <th>Actions</th>
            </tr>
            {% for file in files %}
            <tr>
                <td>{{ file }}</td>
                <td>
                    <a href="{{ url_for('edit_file', filename=file) }}">Edit</a>
                </td>
            </tr>
            {% endfor %}
        </table>
        <a href="{{ url_for('logout') }}" style="display: block; margin-top: 20px;">Logout</a>
    </div>
</body>
</html>

